<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>

<html>
<head>
<link href="${ctx}/static/bootstrap/2.2.2/css/bootstrap.css" type="text/css" rel="stylesheet" />
	<title>角色管理</title>
</head>

<body>
	<fieldset>
			<legend><small>管理角色</small></legend>
	<c:if test="${not empty message}">
		<div id="message" class="alert alert-success"><button data-dismiss="alert" class="close">×</button>${message}</div>
	</c:if>
	
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead><tr><th>角色</th><th>权限</th><th>管理</th></tr></thead>
		<tbody>
		<c:forEach items="${roleList}" var="role">
			<tr>
				<td><a href="${ctx}/admin/role/update/${role.id}">${role.name}</a></td>
				<td>${role.permissions}</td>
				
				<td><a href="${ctx}/admin/role/delete/${role.id}" onclick="confirm('确定删除?')">删除</a></td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div><a class="btn" href="${ctx}/admin/role/add">创建角色</a></div>
	</fieldset>
</body>
</html>
